/*
 * Filename: g:\espidf_workspace\idf_S3_T-Watch\main\devices\rtc_clock.h
 * Path: g:\espidf_workspace\idf_S3_T-Watch\main\devices
 * Created Date: Friday, June 20th 2025, 3:26:18 pm
 * Author: sss
 * 
 * Copyright (c) 2025 Your Company
 */

#pragma once
#include "time.h"

class RTC_Clock {
public:
    RTC_Clock();
    ~RTC_Clock();

    void init();

    time_t now();//获取当前rtc时间
    time_t now_system_time();//获取当前系统时间

    void set_time_RTC(time_t t);//设置当前时间到RTC中
    void set_time(time_t t);//设置当前时间到系统时间
    void set_time();//设置当前RTC时间到系统时间

    

private:
    time_t _time;
    struct tm timeinfo_storage;
    struct tm *timeinfo = &timeinfo_storage;
};